import { createRouter, createWebHistory, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: '布局',
    component: () => import(/* webpackChunkName: "about" */ '../views/Layout.vue'),
    //定义嵌套路由
    children:[
      {
        path: '/admin',
        name: '管理员页面内容组件',
        component: () => import(/* webpackChunkName: "about" */ '../views/Admin.vue'),
      },
      {
        path: '/role',
        name: '角色页面内容组件',
        component: () => import(/* webpackChunkName: "about" */ '../views/Role.vue'),
      },
      {
        path: '/menu',
        name: '菜单页面内容组件',
        component: () => import(/* webpackChunkName: "about" */ '../views/Menu.vue'),
      },
    ]
  }
]

const router = createRouter({
    // history: createWebHashHistory(), // createWebHashHistory 路径加#号
    history: createWebHistory(),
    routes
})


export default router;